package com.xiaohe66.web.domain.common.agg;

import com.xiaohe66.web.domain.common.value.TagDesc;
import com.xiaohe66.web.domain.common.value.TagId;
import com.xiaohe66.web.domain.common.value.TagName;
import com.xiaohe66.web.integration.domain.Aggregate;
import com.xiaohe66.web.integration.value.Color;
import lombok.Builder;
import lombok.Getter;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import lombok.ToString;

/**
 * @author xiaohe
 * @since 2023-01-29 11:53
 */
@Builder
@Getter
@ToString
@RequiredArgsConstructor
public class Tag implements Aggregate<Tag, TagId> {

    @NonNull
    private final TagId id;

    @NonNull
    private final TagName name;

    @NonNull
    private Color background;

    @NonNull
    private Color color;

    @NonNull
    private TagDesc desc;

    @Override
    public boolean hasSameRootAttribute(Tag other) {
        return other != null;
    }
}
